//
//  LightBullet.m
//  TowerDefence
//
//  Created by K3 on 6/7/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "LightBullet.h"

@implementation LightBullet

-(id)initLightBulletWith:(GameLayer *)_gameLayer tower:(GameObject *)_tower {
    self = [super initBulletObjectWith:_gameLayer tower:_tower];
    
    velocity = 0.25f;
    damage = 2;
    [self loadBulletComponent];
    
    return self;
}

-(void)loadBulletComponent {
    spriteBody = [[CCSprite alloc]initWithFile:IMAGE_STAR_EFFECT];
}

-(void)fireTarget:(CGPoint)_targetPoint {
    targetPoint = _targetPoint;
    [self moveToTarget];
}

-(void)moveToTarget {  
    CCCallFunc *firedCallback = [CCCallFunc actionWithTarget:self selector:@selector(hitTargetCallback)];
    [spriteBody runAction:[CCSequence actions:[CCMoveTo actionWithDuration:velocity position:targetPoint], [CCHide action], firedCallback, nil]];
}

-(void)hitTargetCallback {
    [super hitTargetCallback];
}

-(void)dealloc {
    [super dealloc];
}

@end
